package com.ys.service.sys.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;
import com.ys.entity.sys.YsIcon;
import com.ys.mapper.sys.YsIconMapper;
import com.ys.service.sys.YsIconService;
import com.ys.vo.R;

@Service("ysIconService")
public class YsIconServiceImpl implements YsIconService {
	
	@Autowired
	private YsIconMapper ysIconMapper;
	
	@Override
	public R add(Map<String, Object> params) {
		
		YsIcon entity = JSON.parseObject(JSON.toJSONString(params), YsIcon.class);
		
		ysIconMapper.insert(entity);
		return R.ok("操作成功");
	}
	
	@Override
	public R edit(Map<String, Object> params) {

		YsIcon entity = JSON.parseObject(JSON.toJSONString(params), YsIcon.class);
		ysIconMapper.update(entity);
		return R.ok("操作成功");
	}

	@Override
	public R deleteTrue(Long id) {
		ysIconMapper.deleteTrue(id);
		return R.ok();
	}
}
	

